import java.util.*;

public class Player
{
    private int strength = 100;
    private Map<String, Thing> bag = new HashMap<>();
    
    public void step(){
        this.strength -= 10;
        System.out.println("你的能量："+ strength);
        if(this.strength<=0){
            System.out.println("你的能量已经不足了，要去休息休息了。");
            System.exit(1);
        }
    }
    public boolean gameover(){
        if(strength <= 0){
            System.out.println("你的能量已经不足了，要去休息休息了。");
            return true;
        }
        return false;
    }
    public void eat(String thingName){
        Thing thing = bag.get(thingName);
        if(thing !=null){
            this.strength += thing.getEnergy();
            if(this.strength > 100) {
                this.strength =100;
        }
          System.out.println("能量+："+ thing.getEnergy()+" .");
          bag.remove(thingName);
          System.out.println("全部能量：" + this.strength);
        }
        else{
        System.out.println("这里没有东西可以收取噢！"); 
        }
    }
    
    public void pick(Thing thing){
        bag.put(thing.getName(),thing);
    } 
    
    public int getminusStrength(){
        this.strength=this.strength-5;
        return this.strength;
    }
}    
